﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nes4Net
{
    public class utils
    {
        public static void copyArrayElements<T>(T[] src, Int32 srcPos, T[] dest, Int32 destPos, Int32 length)
        {
            //for (var i = 0; i < length; ++i)
            //{
            //    dest[destPos + i] = src[srcPos + i];
            //}
            Array.Copy(src, srcPos, dest,destPos, length);
        }

        public static T[] copyArray<T>(T[] src)
        {
            var result = new T[src.Length];
            Array.Copy(src, result, result.Length);
            return result;
        }

  //fromJSON(obj, state)
  //      {
  //          for (var i = 0; i < obj.JSON_PROPERTIES.length; i++)
  //          {
  //              obj[obj.JSON_PROPERTIES[i]] = state[obj.JSON_PROPERTIES[i]];
  //          }
  //      }

        //public dynamic toJSON(object obj)
        //{
        //    var state = { };
        //    for (var i = 0; i < obj.JSON_PROPERTIES.length; i++)
        //    {
        //        state[obj.JSON_PROPERTIES[i]] = obj[obj.JSON_PROPERTIES[i]];
        //    }
        //    return state;
        //}
    }
}
